#pragma once
#include "stdafx.h"
#include <OISInputManager.h>
#include <OISMouse.h>
#include <OISKeyboard.h>
#include "GUI.h"
#include "CameraMan.h"

class Input: public OIS::KeyListener, public OIS::MouseListener, public Ogre::Singleton<Input>
{
public:
	Input(size_t windowHnd, GUI* gui, CameraMan* camera);
	virtual ~Input(void);

	void capture();
	void injectWindowResize(int width, int height);

	OIS::InputManager* getInputManager() const { return inputManager; }
	void setInputManager(OIS::InputManager* val) { inputManager = val; }

	OIS::Keyboard* getKeyboard() const { return keyboard; }
	void setKeyboard(OIS::Keyboard* val) { keyboard = val; }

	OIS::Mouse* getMouse() const { return mouse; }
	void setMouse(OIS::Mouse* val) { mouse = val; }

	GUI* getGui() const { return gui; }
	void setGui(GUI* val) { gui = val; }

	CameraMan* getCamera() const { return camera; }
	void setCamera(CameraMan* val) { camera = val; }

protected:
	//OIS::KeyListener
	virtual bool keyPressed(const OIS::KeyEvent& event);
	virtual bool keyReleased(const OIS::KeyEvent& event);
	//OIS::MouseListener
	virtual bool mousePressed(const OIS::MouseEvent& event, OIS::MouseButtonID id );
	virtual bool mouseMoved(const OIS::MouseEvent& event);
	virtual bool mouseReleased(const OIS::MouseEvent& event, OIS::MouseButtonID id );

private:
	OIS::InputManager* inputManager;	
	OIS::Keyboard* keyboard;
	OIS::Mouse* mouse;

	bool GUIMode;

	GUI* gui;
	CameraMan* camera;
};

